﻿package javase.socket.net;

//Demonstrate InetAddress.
import java.net.*;

public class InetAddressTest {
	public static void main(String args[]) throws UnknownHostException {
		InetAddress Address = InetAddress.getLocalHost();
		System.out.println(Address);
		Address = InetAddress.getByName("osborne.com");
		System.out.println(Address);
		InetAddress SW[] = InetAddress.getAllByName("www.nba.com");
		for (int i = 0; i < SW.length; i++)
			System.out.println(SW[i]);
	}
}
/* run result
john/192.168.0.66
osborne.com/12.163.148.248
www.nba.com/64.62.216.33
www.nba.com/64.62.216.26
*/